package com.vtuzx.kingdee.xqc_core.dao;

import com.mongodb.client.result.InsertManyResult;
import com.vtuzx.core.db.mongo.impl.VtuzxDaoImpl;
import org.bson.BsonValue;
import org.bson.Document;
import org.bson.types.ObjectId;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 即时库存履历Dao
 */
@Component
public class InventoryHistoryDao extends VtuzxDaoImpl {
    /** 集合名 */
    public static final String NAME = "t_inventory_history";
    /**
     * 构造
     */
    public InventoryHistoryDao() {
        super(NAME);
    }

    /**
     * 插入履历
     *
     * @param _userId 用户ID
     * @param userName 用户名
     * @param doc 对象
     * @return insertId
     */
    public ObjectId insertHistory(ObjectId _userId, String userName, Document doc) {
        doc.append("_createUserId", _userId);
        doc.append("createUserName", userName);
        doc.append("_updateUserId", _userId);
        doc.append("updateUserName", userName);
        return this.insertOne(doc);
    }
}
